function fib(n) {
  if (n === 0 || n === 1) return 1
  return fib(n - 1) + fib(n - 2)
}

function fibonacci(n) {
  if (n <= 1) return n
  let fib = [0, 1]
  for (let i = 0; i < n; i++) {
    fib[i] = fib[i - 1] + fib[i - 2]   // 计算第 i 个斐波那契数列的结果
  }

  return fib[n]
}